<html>
<head><meta charset="utf-8"><title>Update PathElem::CapturedVar · t-compiler · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/index.html">t-compiler</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Update.20PathElem.3A.3ACapturedVar.html">Update PathElem::CapturedVar</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="219305020"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Update%20PathElem%3A%3ACapturedVar/near/219305020" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aman Arora <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Update.20PathElem.3A.3ACapturedVar.html#219305020">(Dec 09 2020 at 07:41)</a>:</h4>
<p>Hi! As part of implementing RFC-2229 (capture disjoint fields in closures) , we would like to modify <a href="https://github.com/rust-lang/rust/blob/master/compiler/rustc_mir/src/interpret/validity.rs#L107"><code>PathElem::CapturedVar</code></a> to be <code>CapturedPlace(HirPlace)</code>, where <a href="https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/hir/place/struct.Place.html"><code>HirPlace</code></a> is a  somewhat lossy hir equivalent of MIR Place. </p>
<p>We use HirPlace to now represent closure captures and we are in process of removing closure_captures that is currently used to generate PathElem::CapturedVar in favor of <a href="https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/ty/struct.TypeckResults.html#structfield.closure_min_captures"><code>closure_min_captures</code></a> which uses <code>HirPlace</code></p>
<p>From what I can see within rustc it is only used for writing out paths, but I wanted to check in to see if it's used somewhere I'm not aware of and if the decision to use HirPlace cause problems down the line? </p>
<p>cc <span class="user-mention" data-user-id="300388">@Logan Mosier</span>  <span class="user-mention" data-user-id="303529">@Jennifer Wills</span></p>



<a name="219308238"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Update%20PathElem%3A%3ACapturedVar/near/219308238" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Notification Bot <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Update.20PathElem.3A.3ACapturedVar.html#219308238">(Dec 09 2020 at 08:29)</a>:</h4>
<p>This topic was moved here from <a class="stream-topic" data-stream-id="146212" href="/#narrow/stream/146212-t-compiler.2Fconst-eval/topic/Update.20PathElem.3A.3ACapturedVar">#t-compiler/const-eval &gt; Update PathElem::CapturedVar</a> by <span class="user-mention silent" data-user-id="124288">oli</span></p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>